import request from '@/utils/request'

export function mergeOutboundOrder(data) {//出库操作
    return request({
        url: '/system/outboundOrderV2/merge',
        // url: '/login',
        headers: {
            isToken: true
        },
        method: 'post',
        data: data
    });
}

export function exportOutboundOrder(data) {//出库操作
    return request({
        url: '/system/outboundOrderV2/export',
        headers: {
            isToken: true
        },
        method: 'post',
        data: data
    });
}


export function outbound(outboundForm) {//出库操作
    console.log('outboundForm', outboundForm);
    return request({
        url: '/system/outboundOrderV2/add',
        // url: '/login',
        headers: {
            isToken: true
        },
        method: 'post',
        data: outboundForm
    });
}
export function altJadeStatus(data) {//搜索货品
    return request({
        url: '/system/jade',
        headers: {
            isToken: true
        },
        data:data,
        method: 'put',
    });
}
export function getOutboundOrderCode() {//获取出库单编码
    return request({
        url: '/system/outboundOrderV2/getOutboundOrderCode',
        headers: {
            isToken: true
        },
        method: 'get',
    });
}
// pageNum, pageSize,orderCode,clientId,warehouseId
export function getOutboundOrderList(data) {//获取出库单列表
    return request({
        // url: '/system/outboundOrder/list',
        url: '/system/outboundOrderV2/list',
        headers: {
            isToken: true
        },
        params: data,
        method: 'get',
    });
}
export function getOutboundJadeList(pageNum, pageSize) {//获取出库单列表
    return request({
        url: '/system/jade/list',
        headers: {
            isToken: true
        },
        params: {
            pageNum, pageSize
        },
        method: 'get',
    });
}
export function getJadeByCode(jadeCode) {//扫码出货
    return request({
        url: '/system/jade/list',
        headers: {
            isToken: true
        },
        params: {
            jadeCode
        },
        method: 'get',
    });
}
export function getJadeCrop(jadeUrl) {//图像分割
    return request({
        url: '/api/image/crop',
        headers: {
            isToken: true
        },
        data: jadeUrl,
        method: 'post',
    });
}
export function jadeMatch(imageIds) {//图像匹配
    return request({
        url: '/system/jadeFeature/match',
        headers: {
            isToken: true
        },
        data: imageIds,
        method: 'post',
    });
}
export function getJadeFeature(jadeList) {//提取特征
    return request({
        url: '/api/image/feature',
        headers: {
            isToken: true
        },
        data: jadeList,
        method: 'post',
    });
}
export function getJadeInfo(imageId) {//搜索货品
    return request({
        url: '/system/jade/getJadeByImageId',
        headers: {
            isToken: true
        },
        data:imageId,
        method: 'post',
    });
}


export function getUserList(pageNum,pageSize) {//获取用户列表
    return request({
        url: '/system/basicClient/list',
        headers: {
            isToken: true
        },
        method: 'get',
        params: {
            pageNum,pageSize
        }
    })
}

// 根据条形码或者图片获取列表
export function getJadeByCodeOrImg(params) {
    console.log('params', params);
    return request({
        url: '/system/outboundOrderV2/getJades',
        headers: {
            isToken: true
        },
        params: params,
        method: 'get',
    });
}